1. Load Library


Packages required to run the script

library(tidyverse)
library(igraph)
library(NBZIMM)
library(SpiecEasi)
#devtools::install("/Users/bealab/Desktop/LIMON")
library(LIMON)
library(here)
library(lme4)
library(Matrix)
library(MASS)
library(matrixcalc)
library(gridExtra)
library(devtools)
library(reshape2)
library(ggpubr)
library(broom)
library(ggnewscale)
library(coin)
library(parallel)
library(graph)
library(phyloseq)
library(metagMisc)

2. Data


2.1 - Background

In this script, we will be running the full LIMON pipeline on an infant dataset published in 2019. The data were pulled from this summarized article https://www.nature.com/articles/s41522-022-00345-5/figures/1, specifically reference the study by He et al 2019

He, Xuan, et al. “Fecal microbiome and metabolome of infants fed bovine MFGM supplemented formula or standard formula with breast-fed infants as reference: a randomized controlled trial.” Scientific reports 9.1 (2019): 1-14.

2.2 - Data set up

Load the Metadata

data("He_2019_metadata")

filter down and create some binarys

metadata <- He_2019_metadata %>% 
  dplyr::select(Subject, X, Study.Group, Age, Gender, diet) %>%
  group_by(Subject) %>%
  # Filter to those with at least three visits
  filter(n() >= 4) %>%
  ungroup() %>%
  column_to_rownames("X") %>%
  # add a binary column for Gender
  mutate(Gender_binary = case_when(
    Gender == "Male" ~ 1,
    Gender == "Female" ~ 0)) %>%
  # add a binary column for Diet (Formula or Breastmilk)
  mutate(Diet_binary = case_when(diet == "Standard infant formula" ~ 0,
                                 diet == "Experimental infant formula" ~ 0,
                                 diet == "Breast milk" ~ 1))

Microbial Data

# Microbial Counts
############################################################
data("He_2019_data")

# Mutate column names to keep only the string after the last ";"
colnames(He_2019_data) <- colnames(He_2019_data) %>% 
  str_extract("([^;]+)$")
colnames(He_2019_data) <- make.names(colnames(He_2019_data), unique = TRUE)
He_2019_data <- He_2019_data %>% column_to_rownames("X")

# Ensure no columns sum to 0
raw_counts <- He_2019_data %>%
  dplyr::select(where(~ sum(.) > 0))
# Look at the data
hist(as.matrix(raw_counts), breaks = 100)

Check Mean and standard deviation of the data

# Stats
median(as.matrix(raw_counts))
[1] 0
mean(as.matrix(raw_counts))
[1] 136.861
sd(as.matrix(raw_counts))
[1] 676.3834
# Zeros
percent_zeros <- sum(raw_counts== 0) / (nrow(raw_counts) * ncol(raw_counts)) * 100
percent_zeros
[1] 75.48077

75% of the data is 0’s, and the standard deviation is >> then the mean so it follows a zero-inflated negative binomial distribution

Check some of the features abundance by gender

# Step 1 - Merge metadata with count table
################################################
common_samples <- intersect(rownames(raw_counts), rownames(metadata))
raw_counts <- raw_counts[common_samples, ]
metadata <- metadata[common_samples, ]

# Merge
counts_meta <- merge(metadata, as.matrix(raw_counts), by = 0, all=TRUE)
counts_meta <- counts_meta %>% column_to_rownames("Row.names")

# Step 2 - Mean Abundance by diet
################################################
mean_data <- counts_meta %>%
  group_by(diet = counts_meta[[5]]) %>%
  summarise(across(8:81, mean, na.rm = TRUE)) %>%
  pivot_longer(-diet, names_to = "Variable", values_to = "Mean")

# Plot the mean values by diet
ggplot(mean_data, aes(x = Variable, y = Mean, fill = diet)) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_manual(values = c("darkviolet","steelblue", "darkgreen")) +
  labs(x = "Genus", y = "Mean Abundance Count", title = "Mean Counts by Diet") +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))


# Step 2 - Mean Abundance by gender
################################################
mean_data <- counts_meta %>%
  group_by(Gender = counts_meta[[4]]) %>%
  summarise(across(8:81, mean, na.rm = TRUE)) %>%
  pivot_longer(-Gender, names_to = "Variable", values_to = "Mean")

# Plot the mean values by gender
ggplot(mean_data, aes(x = Variable, y = Mean, fill = as.factor(Gender))) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_manual(values = c("darkviolet","darkgreen")) +
  labs(x = "Genus", y = "Mean Abundance Count", title = "Mean Counts by Gender") +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

CSS normalize the counts

# Create the OTU table 
otu_table <- otu_table(raw_counts, taxa_are_rows = FALSE)
sample_data <- sample_data(metadata)

# CSS norm in Phyloseq
physeq <- phyloseq(otu_table, sample_data)
ps.css <- phyloseq_transform_css(physeq, norm= TRUE, log = TRUE)

normalized_counts <- round(as.data.frame(t(ps.css@otu_table)))

Check some of the features abundance by gender

# Step 1 - Merge metadata with count table
################################################
common_samples <- intersect(rownames(normalized_counts), rownames(metadata))
normalized_counts <- normalized_counts[common_samples, ]
metadata <- metadata[common_samples, ]

# Merge
counts_meta <- merge(metadata, as.matrix(normalized_counts), by = 0, all=TRUE)
counts_meta <- counts_meta %>% column_to_rownames("Row.names")

# Step 2 - Mean Abundance by diet
################################################
mean_data <- counts_meta %>%
  group_by(diet = counts_meta[[5]]) %>%
  summarise(across(8:81, mean, na.rm = TRUE)) %>%
  pivot_longer(-diet, names_to = "Variable", values_to = "Mean")

# Plot the mean values by diet
ggplot(mean_data, aes(x = Variable, y = Mean, fill = diet)) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_manual(values = c("darkviolet","steelblue", "darkgreen")) +
  labs(x = "Genus", y = "Mean Abundance Count", title = "Mean Counts by Diet") +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))


# Step 2 - Mean Abundance by gender
################################################
mean_data <- counts_meta %>%
  group_by(Gender = counts_meta[[4]]) %>%
  summarise(across(8:81, mean, na.rm = TRUE)) %>%
  pivot_longer(-Gender, names_to = "Variable", values_to = "Mean")

# Plot the mean values by gender
ggplot(mean_data, aes(x = Variable, y = Mean, fill = as.factor(Gender))) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_manual(values = c("darkviolet","darkgreen")) +
  labs(x = "Genus", y = "Mean Abundance Count", title = "Mean Counts by Gender") +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

3. LIMON


# Ensure sample counts and metadata are in the same order
common_samples <- intersect(rownames(normalized_counts), rownames(metadata))
normalized_counts <- normalized_counts[common_samples, ]
metadata <- metadata[common_samples, ]


# Make LIMON object
L_obj <- LIMON_Obj(Counts = as.matrix(normalized_counts), 
                           SampleData = metadata)
# Set seed
set.seed(12345)
# Fit the distribution/remove covariates
#########################################
L_obj2 <- LIMON_DistrFit(Obj = L_obj, 
                           Time = "Age", 
                           Subject = "Subject", 
                           Covariates = c("Gender_binary"),
                           model = "Gender_binary",
                           distribution = "GLMM.Z")
Computational iterations: 3 
Computational time: 0 minutes 
Computational iterations: 4 
Computational time: 0.001 minutes 
Computational iterations: 5 
Computational time: 0.001 minutes 
Computational iterations: 4 
Computational time: 0 minutes 
Computational iterations: 5 
Computational time: 0.001 minutes 
Computational iterations: 5 
Computational time: 0.001 minutes 
Computational iterations: 9 
Computational time: 0.001 minutes 
Computational iterations: 4 
Computational time: 0.001 minutes 
Computational iterations: 5 
Computational time: 0.001 minutes 
Computational iterations: 12 
Computational time: 0.002 minutes 
Computational iterations: 5 
Computational time: 0.001 minutes 
Computational iterations: 4 
Computational time: 0.001 minutes 
Computational iterations: 9 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 7 
Computational time: 0.001 minutes 
Computational iterations: 5 
Computational time: 0.001 minutes 
Computational iterations: 4 
Computational time: 0.001 minutes 
Computational iterations: 7 
Computational time: 0.001 minutes 
Computational iterations: 12 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.002 minutes 
Computational iterations: 6 
Computational time: 0.001 minutes 
Computational iterations: 7 
Computational time: 0.001 minutes 
Computational iterations: 6 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 30 
Computational time: 0.004 minutes 
Computational iterations: 14 
Computational time: 0.002 minutes 
Computational iterations: 14 
Computational time: 0.001 minutes 
Computational iterations: 30 
Computational time: 0.004 minutes 
Computational iterations: 15 
Computational time: 0.002 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 9 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 9 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 6 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.002 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 8 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 5 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 15 
Computational time: 0.002 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 23 
Computational time: 0.003 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 13 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 12 
Computational time: 0.002 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.001 minutes 
Computational iterations: 17 
Computational time: 0.002 minutes 
Computational iterations: 12 
Computational time: 0.001 minutes 
Computational iterations: 9 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 9 
Computational time: 0.001 minutes 
Computational iterations: 11 
Computational time: 0.002 minutes 
Computational iterations: 15 
Computational time: 0.002 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
Computational iterations: 15 
Computational time: 0.002 minutes 
Computational iterations: 10 
Computational time: 0.001 minutes 
L_obj2_LMM <- LIMON_DistrFit(Obj = L_obj, 
                           Time = "Age", 
                           Subject = "Subject", 
                           Covariates = c("Gender_binary"),
                           model = "Gender_binary",
                           distribution = "LMM")
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
# Check the data cleaning
################################################
cleaned <- merge(metadata, L_obj2[["Corrected_Counts"]], by = 0)
cleaned <- cleaned %>% column_to_rownames("Row.names")

# Step 2 - Mean Abundance by gender
################################################
mean_data <- cleaned %>%
  group_by(Gender = cleaned[[4]]) %>%
  summarise(across(8:81, mean, na.rm = TRUE)) %>%
  pivot_longer(-Gender, names_to = "Variable", values_to = "Mean")

# Plot the mean values by gender
ggplot(mean_data, aes(x = Variable, y = Mean, fill = as.factor(Gender))) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_manual(values = c("darkviolet","darkgreen")) +
  labs(x = "Genus", y = "Mean Abundance Count", title = "Gender Corrected") +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))



# Check the data cleaning
################################################
cleaned <- merge(metadata, L_obj2_LMM[["Corrected_Counts"]], by = 0)
cleaned <- cleaned %>% column_to_rownames("Row.names")

# Step 2 - Mean Abundance by gender
################################################
mean_data <- cleaned %>%
  group_by(Gender = cleaned[[4]]) %>%
  summarise(across(8:81, mean, na.rm = TRUE)) %>%
  pivot_longer(-Gender, names_to = "Variable", values_to = "Mean")

# Plot the mean values by gender
ggplot(mean_data, aes(x = Variable, y = Mean, fill = as.factor(Gender))) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_manual(values = c("darkviolet","darkgreen")) +
  labs(x = "Genus", y = "Mean Abundance Count", title = "Gender Corrected") +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

Networks per timepoint

set.seed(12345)
# SPIEC-EASI per time
# Set seed
pseed <- list(rep.num=50, seed=10010)


#infer network
L_obj3 <- LIMON_NetInf_Time(Obj = L_obj2, 
                                         method = "glasso", 
                                         sel.criterion = "bstars",
                                         lambda.min.ratio = 0.01,
                                         pulsar.select=TRUE, 
                                         pulsar.params=pseed,
                                         nlambda = 200)

  |                                                                                                          
  |                                                                                                    |   0%
Applying data transformations...
Selecting model with pulsar using bstars...
Fitting final estimate with glasso...
done

  |                                                                                                          
  |=========================                                                                           |  25%
Applying data transformations...
Selecting model with pulsar using bstars...
Fitting final estimate with glasso...
done

  |                                                                                                          
  |==================================================                                                  |  50%
Applying data transformations...
Selecting model with pulsar using bstars...
Fitting final estimate with glasso...
done

  |                                                                                                          
  |===========================================================================                         |  75%
Applying data transformations...
Selecting model with pulsar using bstars...
Fitting final estimate with glasso...
done

  |                                                                                                          
  |====================================================================================================| 100%
# Print Networks
L_obj4 <- LIMON_Edges_Networks(L_obj3, threshold = 0.02, vertex.size = 3, 
                                       vertex.label.cex = 8, vertex.label.color = "black")

Individualized Networks

# Set seed
set.seed(12345)
pseed <- list(rep.num=50, seed=10010)


# individual Networks
L_obj6 <- LIMON_IndNet(Obj = L_obj3, method = "glasso", 
                                         sel.criterion = "bstars",
                                         lambda.min.ratio = 0.01,
                                         pulsar.params=pseed,
                                         nlambda = 200)


# Save the object
saveRDS(L_obj6, here("Output","He_2019", "HE2019_LIMON.rds"))
# option to read the object back in
L_obj6 <- readRDS(here("Output","He_2019", "HE2019_LIMON.rds"))

# Extract edges and centralities
L_obj7<- LIMON_IndEdges(L_obj6, threshold = 0.02)
L_obj8 <- LIMON_Centralities(L_obj7, threshold = 0.02)

Get the edges Note for getting the edges, you need to have more than one level of your dependent variable. In the case of this study, they had two different study groups at ages 4 and 6 months, but not 2 and 12 months.

# Create a new object
L_obj9 <- L_obj8


L_obj9 <- LIMON_StatNodes2(L_obj9, dependent = "diet", time = "Age",
                           method ="multinom", timepoints= NULL, plot_nodes = FALSE, 
                           estimate = NULL, custom_colors = NULL, point_size = 8)
[1] "Skipping interaction g__Faecalibacterium-g__Anaerobutyricum because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Anaerobutyricum because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Anaerobutyricum because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Dorea_A because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Anaeroglobus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Turicibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Longicatena because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Alistipes-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Alistipes-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Roseburia-g__Anaerobutyricum because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea_A-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Alistipes-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Enterococcus_A-g__Longicatena because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Alistipes-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Holdemanella-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Roseburia-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Ruminococcus_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Agathobacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Ruthenibacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Schaedlerella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Clostridium_AP because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__.14 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Anaeroglobus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerostipes-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_AP-g__.14 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea_A-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Longicatena-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dialister-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_Q-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Turicibacter-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Phascolarctobacterium-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Actinomyces-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Coprobacillus-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Coprobacillus-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Coprobacillus-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Coprobacillus-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Coprobacillus-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Coprobacillus-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Coprobacillus-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Lactobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Gemmiger-g__Lactobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactobacillus-g__Anaeroglobus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactobacillus-g__Haemophilus_D because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Senegalimassilia-g__Holdemanella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea_A-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Longicatena-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Gemmiger-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Dorea_A because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Longicatena because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea_A-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Longicatena-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dialister-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Dorea_A because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Hungatella-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Turicibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Haemophilus_D because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Dialister because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Romboutsia-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Dialister because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacillus-g__Longicatena because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacillus-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Turicibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Hungatella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Dialister because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Robinsoniella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Robinsoniella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Robinsoniella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Turicibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Bifidobacterium-g__Blautia because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Faecalibacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Enterococcus_A-g__Faecalibacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Eisenbergiella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Eisenbergiella-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Haemophilus_D-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Anaerobutyricum because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Longicatena because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Haemophilus_D because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Roseburia-g__Clostridium_AP because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Turicibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Akkermansia-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Romboutsia-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_P-g__Anaeroglobus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Akkermansia-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Clostridium_P because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Haemophilus_D because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Romboutsia-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Haemophilus_D because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Ruthenibacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__Ruthenibacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Dorea_A because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Longicatena because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Agathobacter-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea_A-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Longicatena-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_AP-g__Dialister because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Longicatena-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_Q-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_Q-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_Q-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dialister-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_Q-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Longicatena-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dialister-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__.14-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__CAG.41-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_Q-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Ruminococcus_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Agathobacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Dorea_A because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Longicatena because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_P-g__Lactobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Gemmiger-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Gemmiger-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_E-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Senegalimassilia-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Alistipes-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Senegalimassilia-g__Clostridium_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Collinsella-g__Agathobacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Roseburia-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Roseburia-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dorea-g__Lachnospira because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Hungatella-g__Parabacteroides because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Bifidobacterium-g__Clostridium_AQ because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Dialister-g__Alistipes because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Collinsella-g__Ruminococcus_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Collinsella-g__Dorea_A because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Collinsella-g__Holdemanella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Gemmiger-g__Hungatella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Collinsella-g__CAG.217 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Eisenbergiella-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Holdemanella-g__Clostridium_Q because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Roseburia-g__Dorea because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fusicatenibacter-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruthenibacterium-g__Senegalimassilia because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Roseburia-g__Eisenbergiella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Senegalimassilia-g__CAG.41 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Senegalimassilia-g__Prevotella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridioides-g__Holdemanella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Ruminococcus_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Faecalibacterium-g__Dorea_A because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Actinomyces-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__.16-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Hungatella-g__Phascolarctobacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Hungatella-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Senegalimassilia-g__Hungatella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Senegalimassilia-g__Holdemanella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Holdemanella-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Mediterraneibacter-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Mediterraneibacter-g__Acetatifactor because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Phascolarctobacterium-g__Clostridium_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Fimenecus-g__Clostridium_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Escherichia-g__Collinsella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Faecalibacterium because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Escherichia-g__Agathobacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Collinsella-g__Agathobacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_AQ-g__Anaerobutyricum because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Bariatricus-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_B-g__Faecalimonas because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Ruminococcus_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Mediterraneibacter-g__Clostridium_P because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Faecalibacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Collinsella-g__Faecalibacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Hungatella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__.9-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Varibaculum-g__Fimenecus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_B-g__Collinsella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Ruminococcus_B-g__Fusicatenibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Varibaculum-g__Holdemanella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Parabacteroides-g__Clostridium_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__.16 because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Blautia_A-g__Parasutterella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Lactococcus-g__Hungatella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Blautia_A-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Veillonella-g__Mediterraneibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_AQ-g__Mediterraneibacter because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__.9-g__Holdemanella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Robinsoniella-g__Holdemanella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Enterocloster because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridioides-g__Lactococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridioides-g__Senegalimassilia because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridioides-g__Anaeroglobus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridioides-g__Staphylococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Anaerobutyricum-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Haemophilus_D-g__Coprobacillus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Actinomyces because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridioides-g__Hungatella because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Staphylococcus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Anaeroglobus because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Erysipelatoclostridium-g__Clostridium_E because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Clostridium_AQ-g__Gemmiger because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"
[1] "Skipping interaction g__Hungatella-g__Haemophilus_D because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"

Testing outputs - Logistic Regression

Edge_TableTest <- L_obj8[["Merged_Edge_Table"]]
unique_interactions <- unique(Edge_TableTest$Interaction)

# interaction 1
edge_data <- Edge_TableTest %>% filter(Interaction == unique_interactions[1])
edge_data_time <- edge_data %>% filter(edge_data$Age == 2)
node_results <- list()
formula <- as.formula(paste("Diet_binary", "~ Edge_weight"))
model <- glm(formula, data = edge_data_time, family = binomial(link = "logit"))
model_summary <- broom::tidy(model)
model_summary$Interaction <- unique_interactions[1]
time_level <- 2
model_summary$Time_Level <- 2
model_summary$Model_SampleSize <- nobs(model)
node_results[[paste(unique_interactions[1], time_level, sep = "_")]] <- model_summary

# interaction 2
edge_data <- Edge_TableTest %>% filter(Interaction == unique_interactions[2])
edge_data_time <- edge_data %>% filter(edge_data$Age == 2)
formula <- as.formula(paste("Diet_binary", "~ Edge_weight"))
model <- glm(formula, data = edge_data_time, family = binomial(link = "logit"))
model_summary <- broom::tidy(model)
model_summary$Interaction <- unique_interactions[2]
time_level <- 2
model_summary$Time_Level <- 2
model_summary$Model_SampleSize <- nobs(model)
node_results[[paste(unique_interactions[2], time_level, sep = "_")]] <- model_summary

Nodes <- bind_rows(node_results)
Nodes <- Nodes %>% dplyr::filter(term == "Edge_weight")

Testing Output - multinomial model


edge_data <- Edge_TableTest %>% filter(Interaction == unique_interactions[1])
edge_data_time <- edge_data %>% filter(edge_data$Age == 2)
node_results <- list()

unique_levels <- length(unique(edge_data_time[["diet"]]))

formula <- as.formula(paste("diet", "~ Edge_weight"))
model <- nnet::multinom(formula, data = edge_data, trace = FALSE)
model_summary <- broom::tidy(model)
model_summary$Interaction <- unique_interactions[1]
time_level <- 2
model_summary$Time_Level <- 2
model_summary$Model_SampleSize <- nobs(model)
node_results[[paste(unique_interactions[1], time_level, sep = "_")]] <- model_summary

# check
Nodes <- bind_rows(node_results)
Nodes <- Nodes %>% dplyr::filter(term == "Edge_weight")
LIMON_StatNodes2 <- function (LIMON_obj, dependent, node_type = "Edge_weight", pval = 0.5, 
    adjpval = 0.9, time = "Time", method = "lm", timepoints = NULL, 
    plot_nodes = FALSE, estimate = NULL, custom_colors = NULL, 
    point_size = 7) 
{
    library(broom)
    library(dplyr)
    library(nnet)
    library(tidyr)
    library(ggplot2)
  
  # Check messages to ensure the data is present
    if (is.null(LIMON_obj[["Merged_Edge_Table"]])) {
        print("Merged_Edge_Table is not present in the LIMON object. Must run LIMON_IndEdges() first.")
        return(LIMON_obj)
    }
  
  
    # Error Message if they select a linear model but dont have a continuous value with more than 3 values
   if (method == "lm") {
                   # Warning if dependent is not binary
                unique_vals <- unique(LIMON_obj[["Merged_Edge_Table"]][[dependent]])
                  if (length(unique_vals) <= 3 || !is.numeric(unique_vals)) {
                        stop(paste("Error: The dependent variable", dependent, 
                            "must be numeric and continuous (not categorical data) for a linear model. Consider using a different model for this variable"))}}
  
  
  
  # Error Message if they select logit and don't have a binary
   if (method == "logit") {
                   # Warning if dependent is not binary
                unique_vals <- unique(LIMON_obj[["Merged_Edge_Table"]][[dependent]])
                  if (length(unique_vals) != 2 || !all(unique_vals %in% c(0, 1))) {
                        stop(paste("Error: The dependent variable", dependent, 
                            "must be binary (0 and 1) for a logistic regression. Consider converting it to a binary variable or use the multinomial model if more than 2 categories."))}}
  
  
    # Error Message if they select multinom and don't have more than three categories
   if (method == "multinom") {
                   # Warning if dependent is not multinomial
                unique_vals <- unique(LIMON_obj[["Merged_Edge_Table"]][[dependent]])
                  if (length(unique_vals) <= 2) {
                        stop(paste("Error: The dependent variable", dependent, 
                            "must have 3 or more levels overall for a multinomial model. Consider using a different model"))}}
  
  # Option to filter down to timepoints of interest
    if (!is.null(timepoints)) {
        LIMON_obj[["Merged_Edge_Table"]] <- LIMON_obj[["Merged_Edge_Table"]] %>% 
            filter(.data[[time]] == timepoints)
    }
  # Prep the Data First
    if (node_type == "Edge_weight") {
      # get the data
        Edge_Table <- LIMON_obj[["Merged_Edge_Table"]]

        node_results <- list()
            for (time_level in unique(Edge_Table[[time]])) {
                edge_data_time_full <- Edge_Table %>% filter(Edge_Table[[time]] == time_level)
                
                unique_interactions <- unique(Edge_Table$Interaction)
                for (interaction in unique_interactions) {
                    edge_data_time <- edge_data_time_full %>% filter(Interaction == interaction)
                if (nrow(edge_data_time) < 2) {
                  next
                }
                
            # Run the models here
                # 1. Linear Model
              if (method == "lm") {
                formula <- as.formula(paste(dependent, "~ Edge_weight"))
                model <- lm(formula, data = edge_data_time)
                model_summary <- broom::tidy(model)
                model_summary$Interaction <- interaction
                model_summary$Time_Level <- time_level
                model_summary$Model_SampleSize <- stats::nobs(model)
                node_results[[paste(interaction, time_level, 
                  sep = "_")]] <- model_summary
              }
                
                
              # 2. Logistic Model
              if (method == "logit") {
              # Count unique levels
                unique_levels <- length(unique(edge_data_time[[dependent]]))
              # Skip if more than 2 levels
              if (unique_levels != 2) {
                  print(paste("Skipping interaction", interaction, 
                    "because dependent variable has", unique_levels, 
                    "levels. Logistic regression requires exactly 2. Consider using multinomial for more than two or filtering to timepoints that have 2 options."))
                  next } # Skip to the next interaction

              # Proceed with logistic regression if valid
               formula <- as.formula(paste(dependent, "~ Edge_weight"))
               model <- glm(formula, data = edge_data_time, family = binomial(link = "logit"))
               model_summary <- broom::tidy(model)
               model_summary$Interaction <- interaction
               model_summary$Time_Level <- time_level
               model_summary$Model_SampleSize <- stats::nobs(model)
               node_results[[paste(interaction, time_level, sep = "_")]] <- model_summary
               }

                # 3. Multinomial Model
              if (method == "multinom") {
                # Skip if less than 2 levels
                # Count unique levels of the dependent variable
                edge_data_time[[dependent]] <- as.factor(edge_data_time[[dependent]])
                unique_levels <- length(unique(edge_data_time[[dependent]]))
                if (unique_levels <= 2) {
                  print(paste("Skipping interaction", interaction, 
                      "because dependent variable has less than two levels and multinomial requires 3. Consider using logistic regression with binary outcome"))
                next }  # Skip to the next interaction
                formula <- as.formula(paste(dependent, "~Edge_weight"))
                model <- nnet::multinom(formula, data = edge_data_time, trace = FALSE)
                model_summary <- broom::tidy(model)
                model_summary$Interaction <- interaction
                model_summary$Time_Level <- time_level
                model_summary$Model_SampleSize <- stats::nobs(model)
                node_results[[paste(interaction, time_level, sep = "_")]] <- model_summary
                  }
            }
        }
        
        # Summarize the Data
        Nodes <- bind_rows(node_results)
        Nodes <- Nodes %>% dplyr::filter(term == "Edge_weight")
        
        # Adjust p-value for all models
        Nodes <- Nodes %>% dplyr::mutate(p.adjusted = stats::p.adjust(p.value, method = "BH"))
        # Filter by p.value and or adjusted p value
        Nodes <- Nodes %>% dplyr::filter(p.value > 0 & p.value <=  pval) %>% 
                            dplyr::filter(p.adjusted > 0 & p.adjusted <=  adjpval)

        
        # Finish summarizing the data
        sig_interactions <- Nodes$Interaction
        sig_edges <- Edge_Table %>% filter(Interaction %in% sig_interactions)
        unique_nodes <- unique(c(sig_edges$Source, sig_edges$Sink))
        Corrected_Counts <- LIMON_obj[["Corrected_Counts"]]
        SigNodes_Data <- Corrected_Counts[, unique_nodes, drop = FALSE]
        sample_data <- LIMON_obj[["SampleData"]]
        sample_data <- sample_data %>% dplyr::select(all_of(time), 
            all_of(dependent))
        SigNodes_Data <- SigNodes_Data %>% rownames_to_column(var = "SampleID")
        sample_data <- sample_data %>% rownames_to_column(var = "SampleID")
        SigNodes_Data <- merge(sample_data, SigNodes_Data, by = "SampleID", 
            all = TRUE)
        SigNodes_Data <- SigNodes_Data %>% column_to_rownames("SampleID")
    }
    else {
        print("Only takes Edge Weights right now")
        Nodes <- NULL
    }
    LIMON_obj$Nodes_data <- Nodes
    LIMON_obj$Significant_Interactions <- SigNodes_Data
    
    # Plot the nodes ONLY for linear or logistic models
    if (plot_nodes == TRUE & method %in% c("lm", "logit")) {
        sig_nodes <- as.data.frame(LIMON_obj[["Nodes_data"]]) %>% 
            filter(term == "Edge_weight") %>% filter(p.value <= 
            pval) %>% filter(abs(estimate) >= estimate)
        if (is.null(custom_colors)) {
            color_scale <- scale_color_distiller(palette = "Set3", 
                name = "Time")
        }
        else if (is.character(custom_colors) && length(custom_colors) == 
            1) {
            color_scale <- scale_color_distiller(palette = custom_colors, 
                name = "Time")
        }
        else if (is.vector(custom_colors)) {
            color_scale <- scale_color_gradientn(colors = custom_colors, 
                name = "Time")
        }
        else {
            stop("Invalid custom_colors argument. Provide a palette name or a named vector of colors.")
        }
        plot <- sig_nodes %>% arrange(estimate) %>% mutate(Interaction = factor(Interaction, 
            levels = unique(Interaction[order(estimate)]))) %>% 
            ggplot(aes(x = Interaction, y = estimate, color = as.numeric(Time_Level))) + 
            geom_segment(aes(x = Interaction, xend = Interaction, 
                y = 0, yend = estimate), color = "gray") + geom_point(size = point_size) + 
            coord_flip() + theme_bw() + xlab("Interaction") + 
            ylab("Estimate") + ggtitle("Effect Size of Microbial Interactions per Timepoint") + 
            color_scale + theme(axis.text.x = element_text(color = "black", 
            family = "Arial", size = 11), axis.text.y = element_text(color = "black", 
            family = "Arial", size = 11))
        print(plot)
    }
    return(LIMON_obj)
}
LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKIyAxLiBMb2FkIExpYnJhcnkKKioqIApQYWNrYWdlcyByZXF1aXJlZCB0byBydW4gdGhlIHNjcmlwdApgYGB7cn0KbGlicmFyeSh0aWR5dmVyc2UpCmxpYnJhcnkoaWdyYXBoKQpsaWJyYXJ5KE5CWklNTSkKbGlicmFyeShTcGllY0Vhc2kpCiNkZXZ0b29sczo6aW5zdGFsbCgiL1VzZXJzL2JlYWxhYi9EZXNrdG9wL0xJTU9OIikKbGlicmFyeShMSU1PTikKbGlicmFyeShoZXJlKQpsaWJyYXJ5KGxtZTQpCmxpYnJhcnkoTWF0cml4KQpsaWJyYXJ5KE1BU1MpCmxpYnJhcnkobWF0cml4Y2FsYykKbGlicmFyeShncmlkRXh0cmEpCmxpYnJhcnkoZGV2dG9vbHMpCmxpYnJhcnkocmVzaGFwZTIpCmxpYnJhcnkoZ2dwdWJyKQpsaWJyYXJ5KGJyb29tKQpsaWJyYXJ5KGdnbmV3c2NhbGUpCmxpYnJhcnkoY29pbikKbGlicmFyeShwYXJhbGxlbCkKbGlicmFyeShncmFwaCkKbGlicmFyeShwaHlsb3NlcSkKbGlicmFyeShtZXRhZ01pc2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tYWxpemVkX2NvdW50cyksIAogICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVEYXRhID0gbWV0YWRhdGEpCmBgYAoKCmBgYHtyfQojIFNldCBzZWVkCnNldC5zZWVkKDEyMzQ1KQojIEZpdCB0aGUgZGlzdHJpYnV0aW9uL3JlbW92ZSBjb3ZhcmlhdGVzCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCkxfb2JqMiA8LSBMSU1PTl9EaXN0ckZpdChPYmogPSBMX29iaiwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFRpbWUgPSAiQWdlIiwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIFN1YmplY3QgPSAiU3ViamVjdCIsIAogICAgICAgICAgICAgICAgICAgICAgICAgICBDb3ZhcmlhdGVzID0gYygiR2VuZGVyX2JpbmFyeSIpLAogICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbCA9ICJHZW5kZXJfYmluYXJ5IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzdHJpYnV0aW9uID0gIkdMTU0uWiIpCgpMX29iajJfTE1NIDwtIExJTU9OX0Rpc3RyRml0KE9iaiA9IExfb2JqLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgVGltZSA9ICJBZ2UiLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgU3ViamVjdCA9ICJTdWJqZWN0IiwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIENvdmFyaWF0ZXMgPSBjKCJHZW5kZXJfYmluYXJ5IiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsID0gIkdlbmRlcl9iaW5hcnkiLAogICAgICAgICAgICAgICAgICAgICAgICAgICBkaXN0cmlidXRpb24gPSAiTE1NIikKYGBgCgoKCgpgYGB7cn0KIyBDaGVjayB0aGUgZGF0YSBjbGVhbmluZwojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj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VzdCA9IDEpKQpgYGAKCgpOZXR3b3JrcyBwZXIgdGltZXBvaW50CmBgYHtyfQpzZXQuc2VlZCgxMjM0NSkKIyBTUElFQy1FQVNJIHBlciB0aW1lCiMgU2V0IHNlZWQKcHNlZWQgPC0gbGlzdChyZXAubnVtPTUwLCBzZWVkPTEwMDEwKQoKCiNpbmZlciBuZXR3b3JrCkxfb2JqMyA8LSBMSU1PTl9OZXRJbmZfVGltZShPYmogPSBMX29iajIsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZCA9ICJnbGFzc28iLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWwuY3JpdGVyaW9uID0gImJzdGFycyIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFtYmRhLm1pbi5yYXRpbyA9IDAuMDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVsc2FyLnNlbGVjdD1UUlVFLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWxzYXIucGFyYW1zPXBzZWVkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5sYW1iZGEgPSAyMDApCgoKCiMgUHJpbnQgTmV0d29ya3MKTF9vYmo0IDwtIExJTU9OX0VkZ2VzX05ldHdvcmtzKExfb2JqMywgdGhyZXNob2xkID0gMC4wMiwgdmVydGV4LnNpemUgPSAzLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGV4LmxhYmVsLmNleCA9IDgsIHZlcnRleC5sYWJlbC5jb2xvciA9ICJibGFjayIpCmBgYAoKCkluZGl2aWR1YWxpemVkIE5ldHdvcmtzCmBgYHtyfQojIFNldCBzZWVkCnNldC5zZWVkKDEyMzQ1KQpwc2VlZCA8LSBsaXN0KHJlcC5udW09NTAsIHNlZWQ9MTAwMTApCgoKIyBpbmRpdmlkdWF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biAzIHZhbHVlcwogICBpZiAobWV0aG9kID09ICJsbSIpIHsKICAgICAgICAgICAgICAgICAgICMgV2FybmluZyBpZiBkZXBlbmRlbnQgaXMgbm90IGJpbmFyeQogICAgICAgICAgICAgICAgdW5pcXVlX3ZhbHMgPC0gdW5pcXVlKExJTU9OX29ialtbIk1lcmdlZF9FZGdlX1RhYmxlIl1dW1tkZXBlbmRlbnRdXSkKICAgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCh1bmlxdWVfdmFscykgPD0gMyB8fCAhaXMubnVtZXJpYyh1bmlxdWVfdmFscykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgc3RvcChwYXN0ZSgiRXJyb3I6IFRoZSBkZXBlbmRlbnQgdmFyaWFibGUiLCBkZXBlbmRlbnQsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIm11c3QgYmUgbnVtZXJpYyBhbmQgY29udGludW91cyAobm90IGNhdGVnb3JpY2FsIGRhdGEpIGZvciBhIGxpbmVhciBtb2RlbC4gQ29uc2lkZXIgdXNpbmcgYSBkaWZmZXJlbnQgbW9kZWwgZm9yIHRoaXMgdmFyaWFibGUiKSl9fQogIAogIAogIAogICMgRXJyb3IgTWVzc2FnZSBpZiB0aGV5IHNlbGVjdCBsb2dpdCBhbmQgZG9uJ3QgaGF2ZSBhIGJpbmFyeQogICBpZiAobWV0aG9kID09ICJsb2dpdCIpIHsKICAgICAgICAgICAgICAgICAgICMgV2FybmluZyBpZiBkZXBlbmRlbnQgaXMgbm90IGJpbmFyeQogICAgICAgICAgICAgICAgdW5pcXVlX3ZhbHMgPC0gdW5pcXVlKExJTU9OX29ialtbIk1lcmdlZF9FZGdlX1RhYmxlIl1dW1tkZXBlbmRlbnRdXSkKICAgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCh1bmlxdWVfdmFscykgIT0gMiB8fCAhYWxsKHVuaXF1ZV92YWxzICVpbiUgYygwLCAxKSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgc3RvcChwY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bGwodGltZXBvaW50cykpIHsKICAgICAgICBMSU1PTl9vYmpbWyJNZXJnZWRfRWRnZV9UYWJsZSJdXSA8LSBMSU1PTl9vYmpbWyJNZXJnZWRfRWRnZV9UYWJsZSJdXSAlPiUgCiAgICAgICAgICAgIGZpbHRlciguZGF0YVtbdGltZV1dID09IHRpbWVwb2ludHMpCiAgICB9CiAgIyBQcmVwIHRoZSBEYXRhIEZpcnN0CiAgICBpZiAobm9kZV90eXBlID09ICJFZGdlX3dlaWdodCIpIHsKICAgICAgIyBnZXQgdGhlIGRhdGEKICAgICAgICBFZGdlX1RhYmxlIDwtIExJTU9OX29ialtbIk1lcmdlZF9FZGdlX1RhYmxlIl1dCgogICAgICAgIG5vZGVfcmVzdWx0cyA8LSBsaXN0KCkKICAgICAgICAgICAgZm9yICh0aW1lX2xldmVsIGluIHVuaXF1ZShFZGdlX1RhYmxlW1t0aW1lXV0pKSB7CiAgICAgICAgICAgICAgICBlZGdlX2RhdGFfdGltZV9mdWxsIDwtIEVkZ2VfVGFibGUgJT4lIGZpbHRlcihFZGdlX1RhYmxlW1t0aW1lXV0gPT0gdGltZV9sZXZlbCkKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgdW5pcXVlX2ludGVyYWN0aW9ucyA8LSB1bmlxdWUoRWRnZV9UYWJsZSRJbnRlcmFjdGlvbikKICAgICAgICAgICAgICAgIGZvciAoaW50ZXJhY3Rpb24gaW4gdW5pcXVlX2ludGVyYWN0aW9ucykgewogICAgICAgICAgICAgICAgICAgIGVkZ2VfZGF0YV90aW1lIDwtIGVkZ2VfZGF0YV90aW1lX2Z1bGwgJT4lIGZpbHRlcihJbnRlcmFjdGlvbiA9PSBpbnRlcmFjdGlvbikKICAgICAgICAgICAgICAgIGlmIChucm93KGVkZ2VfZGF0YV90aW1lKSA8IDIpIHsKICAgICAgICAgICAgICAgICAgbmV4dAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICMgUnVuIHRoZSBtb2RlbHMgaGVyZQogICAgICAgICAgICAgICAgIyAxLiBMaW5lYXIgTW9kZWwKICAgICAgICAgICAgICBpZiAobWV0aG9kID09ICJsbSIpIHsKICAgICAgICAgICAgICAgIGZvcm11bGEgPC0gYXMuZm9ybXVsYShwYXN0ZShkZXBlbmRlbnQsICJ+IEVkZ2Vfd2VpZ2h0IikpCiAgICAgICAgICAgICAgICBtb2RlbCA8LSBsbShmb3JtdWxhLCBkYXRhID0gZWRnZV9kYXRhX3RpbWUpCiAgICAgICAgICAgICAgICBtb2RlbF9zdW1tYXJ5IDwtIGJyb29tOjp0aWR5KG1vZGVsKQogICAgICAgICAgICAgICAgbW9kZWxfc3VtbWFyeSRJbnRlcmFjdGlvbiA8LSBpbnRlcmFjdGlvbgogICAgICAgICAgICAgICAgbW9kZWxfc3VtbWFyeSRUaW1lX0xldmVsIDwtIHRpbWVfbGV2ZWwKICAgICAgICAgICAgICAgIG1vZGVsX3N1bW1hcnkkTW9kZWxfU2FtcGxlU2l6ZSA8LSBzdGF0czo6bm9icyhtb2RlbCkKICAgICAgICAgICAgICAgIG5vZGVfcmVzdWx0c1tbcGFzdGUoaW50ZXJhY3Rpb24sIHRpbWVfbGV2ZWwsIAogICAgICAgICAgICAgICAgICBzZXAgPSAiXyIpXV0gPC0gbW9kZWxfc3VtbWFyeQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgIyAyLiBMb2dpc3RpYyBNb2RlbAogICAgICAgICAgICAgIGlmIChtZXRob2QgPT0gImxvZ2l0IikgewogICAgICAgICAgICAgICMgQ291bnQgdW5pcXVlIGxldmVscwogICAgICAgICAgICAgICAgdW5pcXVlX2xldmVscyA8LSBsZW5ndGgodW5pcXVlKGVkZ2VfZGF0YV90aW1lW1tkZXBlbmRlbnRdXSkpCiAgICAgICAgICAgICAgIyBTa2lwIGlmIG1vcmUgdGhhbiAyIGxldmVscwogICAgICAgICAgICAgIGlmICh1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